//
//  AddYunDanThreeCell.m
//  ReceiptDelivery
//
//  Created by 吕晶 on 2020/9/17.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "AddYunDanThreeCell.h"
#import "LJCustomTextView.h"
#import "LadingRequireMainModel.h"

@interface AddYunDanThreeCell ()<UITextViewDelegate>

@property (nonatomic, strong) UIView *bgView;

@property (nonatomic, strong) UIImageView *tiImgView;
@property (nonatomic, strong) UIScrollView *faHuoAddressScrollView;
@property (nonatomic, strong) UILabel *marginLine;
@property (nonatomic, strong) UIImageView *shouImgView;
@property (nonatomic, strong) UILabel *shouNameLab;
@property (nonatomic, strong) UILabel *shouAddressLab;
@property (nonatomic, strong) UILabel *shouCompanyLab;
@property (nonatomic, strong) UILabel *marginLine2;
@property (nonatomic, strong) UILabel *linkLine;

@property (nonatomic, strong) UILabel *shouLine;
@property (nonatomic, strong) UIImageView *shouAddressImgView;
@property (nonatomic, strong) UILabel *shouDescLab;
@property (nonatomic, strong) UIButton *shouBtn;

@property (nonatomic, strong) UITextField *linkOrderField;
@property (nonatomic, strong) UILabel *linkOrderLine;
@property (nonatomic, strong) UITextField *requireTimeField;
@property (nonatomic, strong) UILabel *requireTimeLine;
@property (nonatomic, strong) UIButton *requireTimeBtn;
@property (nonatomic, strong) UILabel *serviceTitleLab;
@property (nonatomic, strong) UIView *serviceView;
@property (nonatomic, strong) UILabel *line1;
@property (nonatomic, strong) UILabel *prescriptionTitleLab;
@property (nonatomic, strong) UIView *prescriptionView;
@property (nonatomic, strong) UILabel *line2;
@property (nonatomic, strong) UITextField *shippingField;
@property (nonatomic, strong) UIButton *shippingBtn;
@property (nonatomic, strong) UILabel *line3;
@property (nonatomic, strong) UITextField *requireField;
@property (nonatomic, strong) UIButton *requireBtn;
@property (nonatomic, strong) UILabel *line4;
@property (nonatomic, strong) UITextField *styleField;
@property (nonatomic, strong) UIButton *styleBtn;
@property (nonatomic, strong) UILabel *lineStyle;
@property (nonatomic, strong) UITextField *weightField;
@property (nonatomic, strong) UILabel *line5;
@property (nonatomic, strong) UITextField *volumeField;
@property (nonatomic, strong) UILabel *line6;
@property (nonatomic, strong) UITextField *payWeightField;
@property (nonatomic, strong) UILabel *payWeightLine;
@property (nonatomic, strong) UITextField *payVolumeField;
@property (nonatomic, strong) UILabel *payVolumeLine;
@property (nonatomic, strong) UITextField *insuranceField;
@property (nonatomic, strong) UILabel *line7;
@property (nonatomic, strong) UILabel *huiDanTitleLab;
@property (nonatomic, strong) UILabel *huiDanLine;
@property (nonatomic, strong) UIView *huiDanBtnBGView;
@property (nonatomic, strong) UIButton *huiDanYesBtn;
@property (nonatomic, strong) UIButton *huiDanNoBtn;
@property (nonatomic, strong) UILabel *fileTitleLab;
@property (nonatomic, strong) UILabel *fileCountLab;
@property (nonatomic, strong) LJCustomTextView *fileTextView;
@property (nonatomic, strong) UILabel *line8;
@property (nonatomic, strong) UILabel *remarkTitleLab;
@property (nonatomic, strong) UILabel *remarkCountLab;
@property (nonatomic, strong) LJCustomTextView *remarkTextView;
@property (nonatomic, strong) UIView *tipsView;

@end

@implementation AddYunDanThreeCell

+ (instancetype)AddYunDanThreeCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"AddYunDanThreeCell";
    AddYunDanThreeCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[AddYunDanThreeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = Color_backgroundColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.bgView = [UIView new];
        self.bgView.backgroundColor = HexColor(0xffffff);
        self.bgView.layer.masksToBounds = YES;
        self.bgView.layer.cornerRadius = 6;
        [self.contentView addSubview:self.bgView];
        
        self.tiImgView = [UIImageView new];
        self.tiImgView.image = [UIImage imageNamed:@"icon_add_ti"];
        [self.bgView addSubview:self.tiImgView];
        
        self.faHuoAddressScrollView = [UIScrollView new];
        [self.bgView addSubview:self.faHuoAddressScrollView];
        
        self.marginLine = [UILabel new];
        self.marginLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.marginLine];
        
        self.shouImgView = [UIImageView new];
        self.shouImgView.image = [UIImage imageNamed:@"icon_add_shou"];
        [self.bgView addSubview:self.shouImgView];
        
        self.shouNameLab = [UILabel new];
        self.shouNameLab.textColor = HexColor(0x2B2C44);
        self.shouNameLab.font = BoldFontOfSize(16);
        [self.bgView addSubview:self.shouNameLab];
        
        self.shouAddressLab = [UILabel new];
        self.shouAddressLab.textColor = HexColor(0x2B2C44);
        self.shouAddressLab.font = [UIFont systemFontOfSize:14];
        self.shouAddressLab.numberOfLines = 0;
        [self.bgView addSubview:self.shouAddressLab];
        
        self.shouCompanyLab = [UILabel new];
        self.shouCompanyLab.textColor = HexColor(0x2B2C44);
        self.shouCompanyLab.font = [UIFont systemFontOfSize:14];
        self.shouCompanyLab.numberOfLines = 0;
        [self.bgView addSubview:self.shouCompanyLab];
        
        self.marginLine2 = [UILabel new];
        self.marginLine2.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.marginLine2];
        
        self.linkLine = [UILabel new];
        self.linkLine.backgroundColor = HexColorA(0x3D68EB, 0.2);
        [self.bgView addSubview:self.linkLine];
        
        self.shouLine = [UILabel new];
        self.shouLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.shouLine];
        
        self.shouAddressImgView = [UIImageView new];
        self.shouAddressImgView.image = [UIImage imageNamed:@"icon_choose_address"];
        [self.bgView addSubview:self.shouAddressImgView];
        
        self.shouDescLab = [UILabel new];
        self.shouDescLab.textColor = HexColor(0x585974);
        self.shouDescLab.font = [UIFont systemFontOfSize:10];
        [self.bgView addSubview:self.shouDescLab];
        
        self.shouBtn = [UIButton new];
        [self.shouBtn addTarget:self action:@selector(shouClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:self.shouBtn];
        
        self.linkOrderLine = [UILabel new];
        self.linkOrderLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.linkOrderLine];
        
        self.linkOrderField = [UITextField new];
        self.linkOrderField.textColor = HexColor(0x2B2C44);
        self.linkOrderField.font = [UIFont systemFontOfSize:14];
        self.linkOrderField.textAlignment = NSTextAlignmentRight;
        self.linkOrderField.placeholder = @"请输入";
        [self.linkOrderField addTarget:self action:@selector(linkOrderFieldChange:) forControlEvents:UIControlEventEditingChanged];
        [self.bgView addSubview:self.linkOrderField];
        
        self.requireTimeLine = [UILabel new];
        self.requireTimeLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.requireTimeLine];
        
        self.requireTimeField = [UITextField new];
        self.requireTimeField.textColor = HexColor(0x2B2C44);
        self.requireTimeField.font = [UIFont systemFontOfSize:14];
        self.requireTimeField.textAlignment = NSTextAlignmentRight;
        self.requireTimeField.placeholder = @"请选择";
        [self.bgView addSubview:self.requireTimeField];
        
        self.requireTimeBtn = [UIButton new];
        [self.requireTimeBtn addTarget:self action:@selector(requireTimeClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:self.requireTimeBtn];
        
        self.serviceTitleLab = [UILabel new];
        self.serviceTitleLab.textColor = HexColor(0x2B2C44);
        self.serviceTitleLab.font = [UIFont systemFontOfSize:14];
        self.serviceTitleLab.text = @"服务方式";
        [self.bgView addSubview:self.serviceTitleLab];
        
        self.serviceView = [UIView new];
        [self.bgView addSubview:self.serviceView];
        
        self.line1 = [UILabel new];
        self.line1.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line1];
        
        self.prescriptionTitleLab = [UILabel new];
        self.prescriptionTitleLab.textColor = HexColor(0x2B2C44);
        self.prescriptionTitleLab.font = [UIFont systemFontOfSize:14];
        self.prescriptionTitleLab.text = @"运输时效";
        [self.bgView addSubview:self.prescriptionTitleLab];
        
        self.prescriptionView = [UIView new];
        [self.bgView addSubview:self.prescriptionView];
        
        self.line2 = [UILabel new];
        self.line2.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line2];
        
        self.shippingField = [UITextField new];
        self.shippingField.textColor = HexColor(0x2B2C44);
        self.shippingField.font = [UIFont systemFontOfSize:14];
        self.shippingField.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.shippingField];
        
        self.shippingBtn = [UIButton new];
        [self.shippingBtn addTarget:self action:@selector(shippingClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:self.shippingBtn];
        
        self.line3 = [UILabel new];
        self.line3.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line3];
        
        self.requireField = [UITextField new];
        self.requireField.textColor = HexColor(0x2B2C44);
        self.requireField.font = [UIFont systemFontOfSize:14];
        self.requireField.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.requireField];
        
        self.requireBtn = [UIButton new];
        [self.requireBtn addTarget:self action:@selector(requireClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:self.requireBtn];
        
        self.line4 = [UILabel new];
        self.line4.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line4];
        
        self.styleField = [UITextField new];
        self.styleField.textColor = HexColor(0x2B2C44);
        self.styleField.font = [UIFont systemFontOfSize:14];
        self.styleField.textAlignment = NSTextAlignmentRight;
        [self.bgView addSubview:self.styleField];
        
        self.styleBtn = [UIButton new];
        [self.styleBtn addTarget:self action:@selector(jieSuanClick) forControlEvents:UIControlEventTouchUpInside];
        [self.bgView addSubview:self.styleBtn];
        
        self.lineStyle = [UILabel new];
        self.lineStyle.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.lineStyle];
        
        self.weightField = [UITextField new];
        self.weightField.textColor = HexColor(0x2B2C44);
        self.weightField.font = [UIFont systemFontOfSize:14];
        self.weightField.placeholder = @"";
        self.weightField.textAlignment = NSTextAlignmentRight;
        self.weightField.keyboardType = UIKeyboardTypeDecimalPad;
        self.weightField.userInteractionEnabled = NO;
        [self.bgView addSubview:self.weightField];
        
        self.line5 = [UILabel new];
        self.line5.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line5];
        
        self.volumeField = [UITextField new];
        self.volumeField.textColor = HexColor(0x2B2C44);
        self.volumeField.font = [UIFont systemFontOfSize:14];
        self.volumeField.placeholder = @"";
        self.volumeField.textAlignment = NSTextAlignmentRight;
        self.volumeField.keyboardType = UIKeyboardTypeDecimalPad;
        self.volumeField.userInteractionEnabled = NO;
        [self.bgView addSubview:self.volumeField];
        
        self.line6 = [UILabel new];
        self.line6.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line6];
        
        self.payWeightField = [UITextField new];
        self.payWeightField.textColor = HexColor(0x2B2C44);
        self.payWeightField.font = [UIFont systemFontOfSize:14];
        self.payWeightField.placeholder = @"默认同总重量";
        self.payWeightField.textAlignment = NSTextAlignmentRight;
        self.payWeightField.keyboardType = UIKeyboardTypeDecimalPad;
        [self.payWeightField addTarget:self action:@selector(payWeightFieldChange:) forControlEvents:UIControlEventEditingChanged];
        [self.bgView addSubview:self.linkOrderField];
        [self.bgView addSubview:self.payWeightField];
        
        self.payWeightLine = [UILabel new];
        self.payWeightLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.payWeightLine];
        
        self.payVolumeField = [UITextField new];
        self.payVolumeField.textColor = HexColor(0x2B2C44);
        self.payVolumeField.font = [UIFont systemFontOfSize:14];
        self.payVolumeField.placeholder = @"默认同总体积";
        self.payVolumeField.textAlignment = NSTextAlignmentRight;
        self.payVolumeField.keyboardType = UIKeyboardTypeDecimalPad;
        [self.payVolumeField addTarget:self action:@selector(payVolumeFieldChange:) forControlEvents:UIControlEventEditingChanged];
        [self.bgView addSubview:self.payVolumeField];
        
        self.payVolumeLine = [UILabel new];
        self.payVolumeLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.payVolumeLine];
        
        self.insuranceField = [UITextField new];
        self.insuranceField.textColor = HexColor(0x2B2C44);
        self.insuranceField.font = [UIFont systemFontOfSize:14];
        self.insuranceField.placeholder = @"请输入";
        self.insuranceField.textAlignment = NSTextAlignmentRight;
        self.insuranceField.keyboardType = UIKeyboardTypeDecimalPad;
        [self.insuranceField addTarget:self action:@selector(insuranceFieldChange:) forControlEvents:UIControlEventEditingChanged];
        [self.bgView addSubview:self.insuranceField];
        
        self.line7 = [UILabel new];
        self.line7.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line7];
        
        self.huiDanTitleLab = [UILabel new];
        self.huiDanTitleLab.textColor = HexColor(0x2B2C44);
        self.huiDanTitleLab.font = [UIFont systemFontOfSize:14];
        self.huiDanTitleLab.text = @"是否需要回单上缴";
        [self.bgView addSubview:self.huiDanTitleLab];
        
        self.huiDanLine = [UILabel new];
        self.huiDanLine.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.huiDanLine];
        
        self.huiDanBtnBGView = [UIView new];
        self.huiDanBtnBGView.backgroundColor = HexColor(0xF2F2F5);
        self.huiDanBtnBGView.layer.masksToBounds = YES;
        [self.bgView addSubview:self.huiDanBtnBGView];
        
        self.huiDanYesBtn = [UIButton new];
        self.huiDanYesBtn.layer.masksToBounds = YES;
        [self.huiDanYesBtn setTitle:@"是" forState:0];
        self.huiDanYesBtn.titleLabel.font = BoldFontOfSize(12);
        [self.huiDanYesBtn addTarget:self action:@selector(huiDanClick) forControlEvents:UIControlEventTouchUpInside];
        [self.huiDanBtnBGView addSubview:self.huiDanYesBtn];
        
        self.huiDanNoBtn = [UIButton new];
        self.huiDanNoBtn.layer.masksToBounds = YES;
        [self.huiDanNoBtn setTitle:@"否" forState:0];
        self.huiDanNoBtn.titleLabel.font = BoldFontOfSize(12);
        [self.huiDanNoBtn addTarget:self action:@selector(huiDanClick) forControlEvents:UIControlEventTouchUpInside];
        [self.huiDanBtnBGView addSubview:self.huiDanNoBtn];
        
        self.fileTitleLab = [UILabel new];
        self.fileTitleLab.textColor = HexColor(0x2B2C44);
        self.fileTitleLab.font = [UIFont systemFontOfSize:14];
        self.fileTitleLab.text = @"随附文件";
        [self.bgView addSubview:self.fileTitleLab];
        
        self.fileCountLab = [UILabel new];
        self.fileCountLab.textColor = HexColor(0xBDBED9);
        self.fileCountLab.font = [UIFont systemFontOfSize:12];
        self.fileCountLab.text = @"0/255";
        [self.bgView addSubview:self.fileCountLab];
        
        self.fileTextView = [LJCustomTextView new];
        self.fileTextView.placeholder = @"请输入";
        self.fileTextView.textColor = HexColor(0x2B2C44);
        self.fileTextView.font = [UIFont systemFontOfSize:14];
        self.fileTextView.textLength = 255;
        __weak_self;
        self.fileTextView.countBlock = ^(NSString * _Nonnull str) {
            weakself.fileCountLab.text = str;
            if (weakself.fileBlock) {
                weakself.fileBlock(weakself.fileTextView.text);
            }
        };
        [self.bgView addSubview:self.fileTextView];
        
        self.line8 = [UILabel new];
        self.line8.backgroundColor = HexColor(0xF2F2F5);
        [self.bgView addSubview:self.line8];
        
        self.remarkTitleLab = [UILabel new];
        self.remarkTitleLab.textColor = HexColor(0x2B2C44);
        self.remarkTitleLab.font = [UIFont systemFontOfSize:14];
        self.remarkTitleLab.text = @"备注";
        [self.bgView addSubview:self.remarkTitleLab];
        
        self.remarkCountLab = [UILabel new];
        self.remarkCountLab.textColor = HexColor(0xBDBED9);
        self.remarkCountLab.font = [UIFont systemFontOfSize:12];
        self.remarkCountLab.text = @"0/255";
        [self.bgView addSubview:self.remarkCountLab];
        
        self.remarkTextView = [LJCustomTextView new];
        self.remarkTextView.placeholder = @"请输入";
        self.remarkTextView.textColor = HexColor(0x2B2C44);
        self.remarkTextView.font = [UIFont systemFontOfSize:14];
        self.remarkTextView.textLength = 255;
        self.remarkTextView.countBlock = ^(NSString * _Nonnull str) {
            weakself.remarkCountLab.text = str;
            if (weakself.remarkBlock) {
                weakself.remarkBlock(weakself.remarkTextView.text);
            }
        };
        [self.bgView addSubview:self.remarkTextView];
        
        self.tipsView = [UIView new];
        [self.bgView addSubview:self.tipsView];
    }
    return self;
}

- (void)shouClick {
    if (self.shouAddressBlock) {
        self.shouAddressBlock();
    }
}

- (void)shippingClick {
    if (self.shippingBlock) {
        self.shippingBlock();
    }
}

- (void)requireClick {
    if (self.requireBlock) {
        self.requireBlock();
    }
}

- (void)jieSuanClick {
    if (self.jieSuanBlock) {
        self.jieSuanBlock();
    }
}

- (void)requireTimeClick {
    if (self.requireTimeBlock) {
        self.requireTimeBlock();
    }
}

- (void)linkOrderFieldChange:(UITextField *)field {
    if (self.linkOrderBlock) {
        self.linkOrderBlock(field.text);
    }
}

- (void)payWeightFieldChange:(UITextField *)field {
    if (self.payWeightBlock) {
        self.payWeightBlock(field.text);
    }
}

- (void)payVolumeFieldChange:(UITextField *)field {
    if (self.payVolumeBlock) {
        self.payVolumeBlock(field.text);
    }
}

- (void)insuranceFieldChange:(UITextField *)field {
    if (self.insuranceBlock) {
        self.insuranceBlock(field.text);
    }
}

- (void)huiDanClick {
    if (self.huiDanBlock) {
        self.huiDanBlock();
    }
}

-(void)setModel:(AddYunDanCangKuModel *)model {
    _model = model;
    [self configUI];
}

- (void)configUI {
    self.bgView.nim_left = 15;
    self.bgView.nim_top = 10;
    self.bgView.nim_width = ScreenW - 2 * self.bgView.nim_left;
    
    self.marginLine.frame = CGRectMake(52, 92, self.bgView.nim_width - 52, 1);
    
    self.faHuoAddressScrollView.frame = CGRectMake(59, 15, self.bgView.nim_width - 59, 67);
    CGFloat scrConW = self.bgView.nim_width - 71 - 59;
    self.faHuoAddressScrollView.contentSize = CGSizeMake(scrConW * self.model.faAddressArray.count, 67);
    [self.faHuoAddressScrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    __block CGFloat scrConLeft = 0;
    [self.model.faAddressArray enumerateObjectsUsingBlock:^(AddYunDanFaHuoAddressModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(scrConLeft, 0, scrConW, 67)];
        scrConLeft = view.nim_right;
        
        UILabel *tiNameLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 2.5, scrConW - 10, 17)];
        tiNameLab.textColor = HexColor(0x2B2C44);
        tiNameLab.font = BoldFontOfSize(16);
        tiNameLab.text = [NSString stringWithFormat:@"%@ %@",obj.liaison,obj.tel];
        [view addSubview:tiNameLab];
        
        UILabel *tiAddressLab = [[UILabel alloc] initWithFrame:CGRectMake(0, tiNameLab.nim_bottom + 10, tiNameLab.nim_width, 15)];
        tiAddressLab.textColor = HexColor(0x2B2C44);
        tiAddressLab.font = [UIFont systemFontOfSize:14];
        tiAddressLab.text = obj.addrs;
        [view addSubview:tiAddressLab];
        
        UILabel * tiCompanyLab = [[UILabel alloc] initWithFrame:CGRectMake(0, tiAddressLab.nim_bottom + 5, tiAddressLab.nim_width, 15)];
        tiCompanyLab.textColor = HexColor(0x2B2C44);
        tiCompanyLab.font = [UIFont systemFontOfSize:14];
        tiCompanyLab.text = obj.name;
        [view addSubview:tiCompanyLab];
        
        [self.faHuoAddressScrollView addSubview:view];
    }];
    
    self.shouNameLab.text = [NSString stringWithFormat:@"%@ %@",self.model.shouAddress.tel_name,self.model.shouAddress.phone];
    [self.shouNameLab sizeToFit];
    self.shouNameLab.nim_left = 59;
    self.shouNameLab.nim_top = 10 + self.marginLine.nim_bottom;
    self.shouNameLab.nim_width = self.bgView.nim_width - 70 - 10 - self.shouNameLab.nim_left;
    
    self.shouAddressLab.nim_width = self.shouNameLab.nim_width;
    self.shouAddressLab.text = self.model.shouAddress.addrs;
    self.shouAddressLab.nim_left = self.shouNameLab.nim_left;
    self.shouAddressLab.nim_top = self.shouNameLab.nim_bottom + 10;
    [self.shouAddressLab sizeToFit];
    self.shouAddressLab.nim_width = self.shouNameLab.nim_width;
    
    self.shouCompanyLab.nim_width = self.shouAddressLab.nim_width;
    self.shouCompanyLab.text = self.model.shouAddress.receiving_name;
    self.shouCompanyLab.nim_left = self.shouAddressLab.nim_left;
    self.shouCompanyLab.nim_top = self.shouAddressLab.nim_bottom + 5;
    [self.shouCompanyLab sizeToFit];
    self.shouCompanyLab.nim_width = self.shouAddressLab.nim_width;
    
    self.marginLine2.nim_left = 0;
    self.marginLine2.nim_top = self.shouCompanyLab.nim_bottom + 15;
    self.marginLine2.nim_width = self.bgView.nim_width;
    self.marginLine2.nim_height = 2;
    
    self.tiImgView.nim_width = 22;
    self.tiImgView.nim_height = 22;
    self.tiImgView.nim_left = 20;
    self.tiImgView.nim_top = (self.marginLine.nim_top - self.tiImgView.nim_width) * 0.5;
    
    self.shouImgView.nim_width = 22;
    self.shouImgView.nim_height = 22;
    self.shouImgView.nim_left = 20;
    self.shouImgView.nim_top = self.marginLine2.nim_top - (self.marginLine2.nim_top - self.marginLine.nim_bottom - self.shouImgView.nim_height) * 0.5 - self.shouImgView.nim_height;
    
    self.shouLine.nim_width = 1;
    self.shouLine.nim_height = 40;
    self.shouLine.nim_left = self.bgView.nim_width - 70 - self.shouLine.nim_width;
    self.shouLine.nim_centerY = self.shouImgView.nim_centerY;
    
    self.shouAddressImgView.nim_width = 18;
    self.shouAddressImgView.nim_height = 18;
    self.shouAddressImgView.nim_top = self.shouLine.nim_top + 2;
    self.shouAddressImgView.nim_left = self.shouLine.nim_right + (70 - self.shouAddressImgView.nim_width) * 0.5;
    
    self.shouDescLab.text = @"修改";
    [self.shouDescLab sizeToFit];
    self.shouDescLab.nim_top = self.shouAddressImgView.nim_bottom + 6;
    self.shouDescLab.nim_centerX = self.shouAddressImgView.nim_centerX;
    
    self.shouBtn.nim_left = self.shouLine.nim_right;
    self.shouBtn.nim_top = self.shouLine.nim_top;
    self.shouBtn.nim_width = 70;
    self.shouBtn.nim_height = self.shouLine.nim_height;
    
    self.linkLine.nim_width = 2;
    self.linkLine.nim_top = self.tiImgView.nim_bottom + 3;
    self.linkLine.nim_height = self.shouImgView.nim_top - 3 - self.linkLine.nim_top;
    self.linkLine.nim_centerX = self.tiImgView.nim_centerX;
    
    self.linkOrderLine.frame = self.line1.frame = CGRectMake(10, 60 + self.marginLine2.nim_bottom, self.bgView.nim_width - 20, 1);
    self.linkOrderField.frame = CGRectMake(self.linkOrderLine.nim_left, self.marginLine2.nim_bottom + 10, self.bgView.nim_width - 2 * self.linkOrderLine.nim_left, 40);
    UILabel *linkOrderTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.linkOrderField.nim_width * 0.5, self.linkOrderField.nim_height)];
    linkOrderTitleLab.text = @"关联订单";
    linkOrderTitleLab.textColor = HexColor(0x2B2C44);
    linkOrderTitleLab.font = [UIFont systemFontOfSize:14];
    self.linkOrderField.leftView = linkOrderTitleLab;
    self.linkOrderField.leftViewMode = UITextFieldViewModeAlways;
    
    self.linkOrderField.text = self.model.requireModel.linkOrder.length?self.model.requireModel.linkOrder:@"";
    
    self.requireTimeLine.frame = self.line1.frame = CGRectMake(10, 60 + self.linkOrderLine.nim_bottom, self.bgView.nim_width - 20, 1);
    self.requireTimeField.frame = CGRectMake(self.requireTimeLine.nim_left, self.linkOrderLine.nim_bottom + 10, self.bgView.nim_width - 2 * self.linkOrderLine.nim_left, 40);
    UILabel *requireTimeTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.requireTimeField.nim_width * 0.5, self.requireTimeField.nim_height)];
    requireTimeTitleLab.text = @"要求到达时间";
    requireTimeTitleLab.textColor = HexColor(0x2B2C44);
    requireTimeTitleLab.font = [UIFont systemFontOfSize:14];
    self.requireTimeField.leftView = requireTimeTitleLab;
    self.requireTimeField.leftViewMode = UITextFieldViewModeAlways;
    
    self.requireTimeField.text = self.model.requireModel.requireTime.length?self.model.requireModel.requireTime:@"";
    
    self.requireTimeBtn.frame = self.requireTimeField.frame;
    
    self.line1.frame = CGRectMake(10, 60 + self.requireTimeLine.nim_bottom, self.bgView.nim_width - 20, 1);
    
    self.serviceTitleLab.nim_left = self.line1.nim_left;
    [self.serviceTitleLab sizeToFit];
    self.serviceTitleLab.nim_top = (self.line1.nim_top - self.requireTimeLine.nim_bottom - self.serviceTitleLab.nim_height) * 0.5 + self.requireTimeLine.nim_top;
    
    self.serviceView.nim_left = self.serviceTitleLab.nim_right + 10;
    self.serviceView.nim_top = (self.line1.nim_top - self.requireTimeLine.nim_bottom - 30) * 0.5 + self.requireTimeLine.nim_top;
    self.serviceView.nim_height = 30;
    self.serviceView.nim_width = self.bgView.nim_width - self.serviceView.nim_left;
    
    if (self.model.requireModel.delivery.count) {
        __block CGFloat btnLeft = self.serviceView.nim_width;
        [self.serviceView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self.model.requireModel.delivery enumerateObjectsUsingBlock:^(LadingDeliveryModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            UIButton *btn = [UIButton new];
            btn.nim_width = [FactoryMethod sizeWithText:obj.name font:[UIFont systemFontOfSize:14] maxSize:CGSizeMake(0, 0)].width + 30;
            btn.nim_height = self.serviceView.nim_height;
            btn.nim_left = btnLeft - 15 - btn.nim_width;
            btn.nim_top = 0;
            [btn setTitle:obj.name forState:0];
            if (obj.isSelected) {
                btn.backgroundColor = Color_ThemeColor;
                [btn setTitleColor:HexColor(0xffffff) forState:0];
            }else {
                btn.backgroundColor = HexColor(0xF2F2F5);
                [btn setTitleColor:HexColor(0xBDBED9) forState:0];
            }
            btn.titleLabel.font = [UIFont systemFontOfSize:14];
            btn.layer.masksToBounds = YES;
            btn.layer.cornerRadius = 15;
            btn.tag = idx;
            [btn addTarget:self action:@selector(serviceClick:) forControlEvents:UIControlEventTouchUpInside];
            [self.serviceView addSubview:btn];
            btnLeft = btn.nim_left;
        }];
    }
    
    self.line2.frame = CGRectMake(self.line1.nim_left, self.line1.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.prescriptionTitleLab.nim_left = self.line2.nim_left;
    [self.prescriptionTitleLab sizeToFit];
    self.prescriptionTitleLab.nim_top = self.line1.nim_bottom + (60 - self.prescriptionTitleLab.nim_height) * 0.5;
    
    self.prescriptionView.nim_left = self.prescriptionTitleLab.nim_right + 10;
    self.prescriptionView.nim_top = self.line1.nim_bottom + (60 - 30) * 0.5;
    self.prescriptionView.nim_height = 30;
    self.prescriptionView.nim_width = self.bgView.nim_width - self.prescriptionView.nim_left;
    
    if (self.model.requireModel.tranTime.count) {
        __block CGFloat btnLeft = self.prescriptionView.nim_width;
        [self.prescriptionView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        [self.model.requireModel.tranTime enumerateObjectsUsingBlock:^(LadingTranTimeModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            UIButton *btn = [UIButton new];
            btn.nim_width = [FactoryMethod sizeWithText:obj.name font:[UIFont systemFontOfSize:14] maxSize:CGSizeMake(0, 0)].width + 30;
            btn.nim_height = self.prescriptionView.nim_height;
            btn.nim_left = btnLeft - 15 - btn.nim_width;
            btn.nim_top = 0;
            [btn setTitle:obj.name forState:0];
            if (obj.isSelected) {
                btn.backgroundColor = Color_ThemeColor;
                [btn setTitleColor:HexColor(0xffffff) forState:0];
            }else {
                btn.backgroundColor = HexColor(0xF2F2F5);
                [btn setTitleColor:HexColor(0xBDBED9) forState:0];
            }
            btn.titleLabel.font = [UIFont systemFontOfSize:14];
            btn.layer.masksToBounds = YES;
            btn.layer.cornerRadius = 15;
            btn.tag = idx;
            [btn addTarget:self action:@selector(tranTimeClick:) forControlEvents:UIControlEventTouchUpInside];
            [self.prescriptionView addSubview:btn];
            btnLeft = btn.nim_left;
        }];
    }
    
    self.line3.frame = CGRectMake(self.line1.nim_left, self.line2.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.shippingField.frame = CGRectMake(self.line1.nim_left, self.line2.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *shipTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.shippingField.nim_width * 0.5, self.shippingField.nim_height)];
    shipTitleLab.text = @"运输方式";
    shipTitleLab.textColor = HexColor(0x2B2C44);
    shipTitleLab.font = [UIFont systemFontOfSize:14];
    self.shippingField.leftView = shipTitleLab;
    self.shippingField.leftViewMode = UITextFieldViewModeAlways;
    
    self.shippingField.text = self.model.requireModel.shippingMode.length?self.model.requireModel.shippingMode:@"";
    
    UIImageView *shipImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
    shipImgView.image = [UIImage imageNamed:@"icon_arrow_down"];
    self.shippingField.rightView = shipImgView;
    self.shippingField.rightViewMode = UITextFieldViewModeAlways;
    
    self.shippingBtn.frame = self.shippingField.frame;
    
    self.line4.frame = CGRectMake(self.line1.nim_left, self.line3.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.requireField.frame = CGRectMake(self.line1.nim_left, self.line3.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *requireTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.requireField.nim_width * 0.5, self.requireField.nim_height)];
    requireTitleLab.text = @"车辆要求";
    requireTitleLab.textColor = HexColor(0x2B2C44);
    requireTitleLab.font = [UIFont systemFontOfSize:14];
    self.requireField.leftView = requireTitleLab;
    self.requireField.leftViewMode = UITextFieldViewModeAlways;
    
    self.requireField.text = self.model.requireModel.carRequireMode.length?self.model.requireModel.carRequireMode:@"";
    
    UIImageView *requireImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
    requireImgView.image = [UIImage imageNamed:@"icon_arrow_down"];
    self.requireField.rightView = requireImgView;
    self.requireField.rightViewMode = UITextFieldViewModeAlways;
    
    self.requireBtn.frame = self.requireField.frame;
    
    self.lineStyle.frame = CGRectMake(self.line1.nim_left, self.line4.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.styleField.frame = CGRectMake(self.line1.nim_left, self.line4.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *styleTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.styleField.nim_width * 0.5, self.styleField.nim_height)];
    styleTitleLab.text = @"结算方式";
    styleTitleLab.textColor = HexColor(0x2B2C44);
    styleTitleLab.font = [UIFont systemFontOfSize:14];
    self.styleField.leftView = styleTitleLab;
    self.styleField.leftViewMode = UITextFieldViewModeAlways;
    
    self.styleField.text = self.model.requireModel.jieSuanType.length?self.model.requireModel.jieSuanType:@"";
    
    UIImageView *styleImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
    styleImgView.image = [UIImage imageNamed:@"icon_arrow_down"];
    self.styleField.rightView = styleImgView;
    self.styleField.rightViewMode = UITextFieldViewModeAlways;
    
    self.styleBtn.frame = self.styleField.frame;
    
    self.line5.frame = CGRectMake(self.line1.nim_left, self.lineStyle.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.weightField.frame = CGRectMake(self.line1.nim_left, self.lineStyle.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *weightTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.weightField.nim_width * 0.5, self.weightField.nim_height)];
    weightTitleLab.text = @"总重量（kg）";
    weightTitleLab.textColor = HexColor(0x2B2C44);
    weightTitleLab.font = [UIFont systemFontOfSize:14];
    self.weightField.leftView = weightTitleLab;
    self.weightField.leftViewMode = UITextFieldViewModeAlways;
    
    self.weightField.text = self.model.requireModel.allWeight.length?self.model.requireModel.allWeight:@"";
    
    self.line6.frame = CGRectMake(self.line1.nim_left, self.line5.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.volumeField.frame = CGRectMake(self.line1.nim_left, self.line5.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *volumeTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.volumeField.nim_width * 0.5, self.volumeField.nim_height)];
    volumeTitleLab.text = @"总体积（m³）";
    volumeTitleLab.textColor = HexColor(0x2B2C44);
    volumeTitleLab.font = [UIFont systemFontOfSize:14];
    self.volumeField.leftView = volumeTitleLab;
    self.volumeField.leftViewMode = UITextFieldViewModeAlways;
    
    self.volumeField.text = self.model.requireModel.allVolume.length?self.model.requireModel.allVolume:@"";
    
    self.payWeightLine.frame = CGRectMake(self.line1.nim_left, self.line6.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.payWeightField.frame = CGRectMake(self.line1.nim_left, self.line6.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *payWeightTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.payWeightField.nim_width * 0.5, self.payWeightField.nim_height)];
    payWeightTitleLab.text = @"计费重量（kg）";
    payWeightTitleLab.textColor = HexColor(0x2B2C44);
    payWeightTitleLab.font = [UIFont systemFontOfSize:14];
    self.payWeightField.leftView = payWeightTitleLab;
    self.payWeightField.leftViewMode = UITextFieldViewModeAlways;
    
    self.payWeightField.text = self.model.requireModel.payWeight.length?self.model.requireModel.payWeight:@"";
    
    self.payVolumeLine.frame = CGRectMake(self.line1.nim_left, self.payWeightLine.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.payVolumeField.frame = CGRectMake(self.line1.nim_left, self.payWeightLine.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *payVolumeTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.payVolumeField.nim_width * 0.5, self.payVolumeField.nim_height)];
    payVolumeTitleLab.text = @"计费体积（m³）";
    payVolumeTitleLab.textColor = HexColor(0x2B2C44);
    payVolumeTitleLab.font = [UIFont systemFontOfSize:14];
    self.payVolumeField.leftView = payVolumeTitleLab;
    self.payVolumeField.leftViewMode = UITextFieldViewModeAlways;
    
    self.payVolumeField.text = self.model.requireModel.payVolume.length?self.model.requireModel.payVolume:@"";
    
    self.line7.frame = CGRectMake(self.line1.nim_left, self.payVolumeLine.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    self.insuranceField.frame = CGRectMake(self.line1.nim_left, self.payVolumeLine.nim_bottom + 10, self.bgView.nim_width - 2 * self.line1.nim_left, 40);
    UILabel *insuranceTitleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.insuranceField.nim_width * 0.5, self.insuranceField.nim_height)];
    insuranceTitleLab.text = @"保险声明价值（元）";
    insuranceTitleLab.textColor = HexColor(0x2B2C44);
    insuranceTitleLab.font = [UIFont systemFontOfSize:14];
    self.insuranceField.leftView = insuranceTitleLab;
    self.insuranceField.leftViewMode = UITextFieldViewModeAlways;
    
    self.insuranceField.text = self.model.requireModel.insuranceValue.length?self.model.requireModel.insuranceValue:@"";
    
    self.huiDanLine.frame = CGRectMake(self.line1.nim_left, self.line7.nim_bottom + 60, self.line1.nim_width, self.line1.nim_height);
    
    [self.huiDanTitleLab sizeToFit];
    self.huiDanTitleLab.nim_left = self.line1.nim_left;
    self.huiDanTitleLab.nim_top = (self.huiDanLine.nim_top - self.line7.nim_bottom - self.huiDanTitleLab.nim_height) * 0.5 + self.line7.nim_bottom;
    
    self.huiDanBtnBGView.nim_width = 72;
    self.huiDanBtnBGView.nim_height = 32;
    self.huiDanBtnBGView.nim_left = self.bgView.nim_width - 15 - self.huiDanBtnBGView.nim_width;
    self.huiDanBtnBGView.nim_centerY = self.huiDanTitleLab.nim_centerY;
    self.huiDanBtnBGView.layer.cornerRadius = 16;
    
    self.huiDanYesBtn.nim_width = 32;
    self.huiDanYesBtn.nim_height = 24;
    self.huiDanYesBtn.nim_left = 4;
    self.huiDanYesBtn.nim_top = 4;
    self.huiDanYesBtn.layer.cornerRadius = 12;
    
    self.huiDanNoBtn.nim_width = 32;
    self.huiDanNoBtn.nim_height = 24;
    self.huiDanNoBtn.nim_left = self.huiDanYesBtn.nim_right;
    self.huiDanNoBtn.nim_top = 4;
    self.huiDanNoBtn.layer.cornerRadius = 12;
    
    if (self.model.requireModel.huiDanStatus == 1) {
        self.huiDanYesBtn.backgroundColor = Color_ThemeColor;
        [self.huiDanYesBtn setTitleColor:HexColor(0xffffff) forState:0];
        self.huiDanNoBtn.backgroundColor = HexColor(0xF2F2F5);
        [self.huiDanNoBtn setTitleColor:HexColor(0x585974) forState:0];
    }else {
        self.huiDanNoBtn.backgroundColor = Color_ThemeColor;
        [self.huiDanNoBtn setTitleColor:HexColor(0xffffff) forState:0];
        self.huiDanYesBtn.backgroundColor = HexColor(0xF2F2F5);
        [self.huiDanYesBtn setTitleColor:HexColor(0x585974) forState:0];
    }
    
    self.fileTitleLab.nim_left = self.line2.nim_left;
    [self.fileTitleLab sizeToFit];
    self.fileTitleLab.nim_top = self.huiDanLine.nim_bottom + (60 - self.fileTitleLab.nim_height) * 0.5;
    
    self.fileCountLab.nim_left = self.fileTitleLab.nim_right + 10;
    [self.fileCountLab sizeToFit];
    self.fileCountLab.nim_bottom = self.fileTitleLab.nim_bottom;
    self.fileCountLab.nim_width += 50;
    
    self.fileTextView.frame = CGRectMake(self.fileTitleLab.nim_left, self.fileTitleLab.nim_bottom + 10, self.bgView.nim_width - 2 * self.fileTitleLab.nim_left, 80);
    
    self.fileTextView.customText = self.model.requireModel.files.length?self.model.requireModel.files:@"";
    
    self.line8.frame = CGRectMake(self.fileTextView.nim_left, self.fileTextView.nim_bottom + 5, self.fileTextView.nim_width, 1);
    
    
    self.remarkTitleLab.nim_left = self.line2.nim_left;
    [self.remarkTitleLab sizeToFit];
    self.remarkTitleLab.nim_top = self.line8.nim_bottom + (60 - self.remarkTitleLab.nim_height) * 0.5;
    
    self.remarkCountLab.nim_left = self.remarkTitleLab.nim_right + 10;
    [self.remarkCountLab sizeToFit];
    self.remarkCountLab.nim_bottom = self.remarkTitleLab.nim_bottom;
    self.remarkCountLab.nim_width += 50;
    
    self.remarkTextView.frame = CGRectMake(self.remarkTitleLab.nim_left, self.remarkTitleLab.nim_bottom + 10, self.bgView.nim_width - 2 * self.remarkTitleLab.nim_left, 80);
    
    self.remarkTextView.customText = self.model.requireModel.remark.length?self.model.requireModel.remark:@"";
    
    if (self.model.requireModel.tipRemarkArray.count) {
        self.tipsView.nim_left = self.remarkTextView.nim_left;
        self.tipsView.nim_top = self.remarkTextView.nim_bottom + 10;
        self.tipsView.nim_width = self.remarkTextView.nim_width;
        __block CGFloat btnLeft = 0;
        __block CGFloat btnTop = 0;
        CGFloat btnH = 30;
        __block CGFloat tipH = 0;
        [self.tipsView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        __weak_self;
        [self.model.requireModel.tipRemarkArray enumerateObjectsUsingBlock:^(LadingRemarkModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            CGFloat textW = [FactoryMethod sizeWithText:obj.name font:[UIFont systemFontOfSize:14] maxSize:CGSizeMake(0, 0)].width;
            CGFloat btnW = textW + 36 > weakself.tipsView.nim_width ? weakself.tipsView.nim_width : textW + 36;
            UIButton *btn = [UIButton new];
            btn.nim_left = btnLeft;
            btn.nim_top = btnTop;
            btn.nim_width = btnW;
            btn.nim_height = btnH;
            if (btnLeft + btn.nim_width > weakself.tipsView.nim_width) {
                btn.nim_left = 0;
                btn.nim_top += btnH + 5;
            }
            [btn setTitle:obj.name forState:0];
            [btn setTitleColor:Color_ThemeColor forState:0];
            btn.titleLabel.font = [UIFont systemFontOfSize:14];
            btn.layer.masksToBounds = YES;
            btn.layer.cornerRadius = 4;
            btn.layer.borderColor = Color_ThemeColor.CGColor;
            btn.layer.borderWidth = 1;
            btn.tag = idx;
            [btn addTarget:self action:@selector(tipBtnClick:) forControlEvents:UIControlEventTouchUpInside];
            [weakself.tipsView addSubview:btn];
            btnLeft = btn.nim_right + 5;
            tipH = btn.nim_bottom;
        }];
        self.tipsView.nim_height = tipH;
        self.bgView.nim_height = self.tipsView.nim_bottom + 10;
    }else {
        self.tipsView.frame = CGRectZero;
        self.bgView.nim_height = self.remarkTextView.nim_bottom + 10;
    }
    
    self.height = self.bgView.nim_bottom + 10;
}

- (void)tranTimeClick:(UIButton *)sender {
    LadingTranTimeModel *model = self.model.requireModel.tranTime[sender.tag];
    if (self.tranTimeBlock) {
        self.tranTimeBlock(model.Id);
    }
}

- (void)serviceClick:(UIButton *)sender {
    LadingDeliveryModel *model = self.model.requireModel.delivery[sender.tag];
    if (self.serviceBlock) {
        self.serviceBlock(model.Id);
    }
}

- (void)tipBtnClick:(UIButton *)sender {
    LadingRemarkModel *model = self.model.requireModel.tipRemarkArray[sender.tag];
    NSString *orText = self.remarkTextView.text;
    if (orText.length) {
        self.remarkTextView.customText = [NSString stringWithFormat:@"%@、%@",orText,model.name];
    }else {
        self.remarkTextView.customText = model.name;
    }
    if (self.remarkChooseBlock) {
        self.remarkChooseBlock(self.remarkTextView.text);
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
